<form action="/admini/managemystore/ingstore" method="get" style="margin:0px">
    <div style=" border:1px solid #DDDDDD; padding:2px; margin:2px;">
        <label for="member">用户：</label><input type="text" id="username" name="username" />
        <label for="logistics">物流单号：</label><input type="text" id="orderno" name="orderno" />
        <label for="starttime">订单时间：</label><input type="text" id="dateinbegin" name="dateinbegin" />
        <label for="endtime">--</label><input type="text" id="dateinend" name="dateinend" />
        <label for="state">状态：</label>
        <select id="state" name="state">
            <option value="">全部</option>
            <option value="0">未付款</option>
            <option value="1">已付款</option>
            <option value="2">已受理</option>
            <option value="3">已发贷</option>
            <option value="4">已入库</option>
            <option value="5">已出库</option>
        </select>
        <input type="submit" id="queryButton" value="查询"/>
    </div>
</form>

<div class="dataTable">
        <table>                                               
            <tr>
                <th width="15px" class="w0">&nbsp;</th>
                <th width="5%" class="w1">ID</th>
                <th width="10%" class="w2">物流单号</th>
                <th width="10%" class="w3">类型</th>
                <th width="10%" class="w4">用户名</th>
                <th width="10%" class="w5">包裹名称</th>
                <th width="10%" class="w6">快递公司</th>
                <th width="10%" class="w7">货物备注</th>
                <th width="10%" class="w8">状态</th>
                <th width="10%" class="w9">提交时间</th>
                <th width="5%" class="w10">操作</th>
            </tr>  
        
            <?php
        if ($this->IngstoreItemList) {
            foreach ($this->IngstoreItemList as $Item) {
                ?>
                <tr>
                    <td class="w0" nowrap>
                        <div><input type="checkbox" id="chk<?php echo $Item->id; ?>" name="ID" /></div>                        
                    </td>
                    <td class="w1" nowrap>
                        <div><?php echo $Item->id; ?></div>                        
                    </td>
                    <td class="w2">
                        <div><?php echo $Item->shipNo; ?></div>
                    </td>
                    <td class="w3" nowrap>
                        <div><?php echo $Item->type; ?></div>
                    </td>
                    <td class="w4" nowrap><div><?php if($Item->userinfo) echo $Item->userinfo->nikename; else echo ''; ?></div></td>
                    <td class="w5">
                        <div><?php echo $Item->name; ?></div>
                    </td>
                    <td class="w6" nowrap>
                        <div><?php echo $Item->shipType; ?></div>
                    </td>
                    <td class="w7">
                        <div><?php echo $Item->remark; ?></div>
                    </td>

                    <td class="w8" nowrap>
                        <div>
                            <?php
                            $stateStr = '';
                            switch ($Item->state) {
                                case '-1':
                                    $stateStr = '已删除';
                                    break;
                                case '0':
                                    $stateStr = '等待入库';
                                    break;
                                case '1':
                                    $stateStr = '已入云仓库';
                                    break;
                                case '2':
                                    $stateStr = '已受理';
                                    break;
                                case '3':
                                    $stateStr = '已发贷';
                                    break;
                                case '4':
                                    $stateStr = '已入库';
                                    break;
                                case '5':
                                    $stateStr = '已出库';
                                    break;
                                default:
                                    $stateStr = '未知';
                                    break;
                            }

                            echo $stateStr;
                            ?>
                        </div>                                          
                    </td>
                    <td class="w9" nowrap><div><?php echo $Item->createtime; ?></div></td>
                    <td class="w10" nowrap>
                        <?php
                        if ($Item->state == 0) {
                            ?>

                            <div><a href="javascript:void(0)" id="<?php echo $Item->id; ?>" class="edit-operation">验货入库</a></div>
                            <?php
                        } else {
                            echo '&nbsp;';
                        }
                        ?>
                    </td>
                </tr>
                        <?php
                    }
                }
                ?>
        </table>
    </div>                
    <div class="toolbar" <?php if (empty($this->IngstoreItemList)) echo "style='display: none'"; ?>>
        <?php echo $this->partial('paging.phtml', array("pages" => $this->IngstoreItem)); ?>
    </div>


<script language="javascript">
    //验货入库
    $(".edit-operation").click( function (){
        window.location.href = "/admini/managemystore/instore?id="+this.id;
    }).css('color','#333');
</script>